<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/html5.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/respond.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/PIE_IE678.js"></script>
<![endif]-->
<link href="__PUBLIC__/Admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Admin/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>新增博文</title>
</head>
<body>
<div class="pd-20">
	<form action="__URL__/art_add_do" method="post" enctype="multipart/form-data" class="form form-horizontal" id="form-article-add">
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>文章标题：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text" value="<?php echo ($viewdata['title']); ?>" placeholder="" id="" name="title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">简略标题：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text" value="<?php echo ($viewdata['Mintitle']); ?>" placeholder="" id="" name="min-title">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>分类栏目：</label>
			<div class="formControls col-2"> <span class="select-box">
				<select name="cid" class="select">
					<?php echo ($data); ?>
				</select>
				</span> </div>
			<label class="form-label col-2">排序值：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="<?php echo (($viewdata['sort_id'])?($viewdata['sort_id']):0); ?>" placeholder="" id="" name="order_by">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">关键词：</label>
			<div class="formControls col-10">
				<input type="text" class="input-text" value="<?php echo ($viewdata['key_word']); ?>" placeholder="" id="" name="key_word">
			</div>
		</div>
		<?php if($mod == 1): ?><div class="row cl">
			<label class="form-label col-2">点击数：</label>
			<div class="formControls col-2">
				<input type="hidden" name="id" value="<?php echo ($viewdata['id']); ?>">
				<input type="text" class="input-text" value="<?php echo (($viewdata['view'])?($viewdata['view']):0); ?>" placeholder="" id="" name="views">
			</div>
			<label class="form-label col-2">评论数：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="<?php echo (($viewdata['common'])?($viewdata['common']):0); ?>" placeholder="" id="" name="common">
			</div>
		</div><?php endif; ?>
		<div class="row cl">
			<label class="form-label col-2">文章摘要：</label>
			<div class="formControls col-10">
				<textarea name="art" cols="" rows="" class="textarea"  placeholder="为空将自动生成摘要" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)"></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">缩略图：</label>
			<div class="formControls col-10">
				<div class="uploader-thum-container">
					<div id="fileList" class="uploader-list">
						<?php if($viewdata['cover'] != ''): ?><div class="file-item-row">
								  <img src="<?php echo ($viewdata['cover']); ?>" alt="">
							  </div><?php endif; ?>	
					</div>
					<div id="filePicker" class="filePicker">选择图片 <input type="file" class="filepicker-btn" name="file_pic" onchange="filepicker(this)"></div>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">添加附件：</label>
			<div class="formControls col-10">
				<input type="checkbox" value="" id="is_atta"> 是否附件
				<span class="filePicker">选择附件 <input type="file" class="filepicker-btn" name="file_name" onchange="fileSelect(this)"></span> <span class="file_"></span>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">文章内容：</label>
			<div class="formControls col-10"> 
				<script id="editor" name="content" type="text/plain" style="width:100%;height:400px;"><?php echo (html_entity_decode($viewdata['content'])); ?></script>
			</div>
		</div>
		<div class="row cl">
			<div class="col-10 col-offset-2">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>
				<button onClick="article_save();" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存草稿</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/layer/1.9.3/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/webuploader/0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="__PUBLIC__/Admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/H-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/baseCommon.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	




	var ue = UE.getEditor('editor');
});
filelist = document.getElementById("fileList");
// 图片选择之后预览
function filepicker(obj){
	var vale = obj.value;
	if(is_allowType(subfix(vale))){
		var view = document.createElement('div');
		view.className = 'file-item-row';
		filelist.innerHTML = '';
		filelist.appendChild(view);
		preview(obj,view);
	}else{
		alert('请选择图片文件');
	}
}

file_ = document.getElementsByClassName('file_')[0];
// 文件选择之后预览
function fileSelect(obj){
	var is_atta = document.getElementById('is_atta');
	if(!is_atta.checked){
		 alert("请勾上允许附件");
		 return;
	}
	var vale = obj.value;
	var type = subfix(vale);
	var name = vale.substring(vale.lastIndexOf("\\")+1);
	var reg = /zip|mp4|mp3/;
	if(reg.test(type)){
            file_.innerHTML = "<b class='my-iconfont "+type+"'></b>已选择:"+name;
 	}else{
		alert('请选择文件');
	}
}

</script>
</body>
</html>